'''
Created on Jun 9, 2011

@author: Avi
'''
if __name__ == '__main__':
    #result_file = open("C:\Users\Avi\Documents\PythonProjects\AI2_results_Bond_vs_NoPenaltyBondPartial.txt","r")
    #parsed_file = open("C:\Users\Avi\Documents\PythonProjects\AI2_results_Bond_vs_NoPenaltyBondParsed.txt","a")
    #result_file = open("C:\Users\Avi\Documents\PythonProjects\Bla.txt","r")
    parsed_file = open("C:\Users\Avi\Documents\PythonProjects\BlaParsed.txt","a")
    
    text = "5    20    1 \n \
    0    0.0    19    0.021689497716894976 \n \
    0    0.0    7    0.01023391812865497 \n \
    W \n \
    5    20    2 \n \
    1    0.055555555555555552    213    0.097572148419606042 \n \
    0    0.0    57    0.034883720930232558 \n \
    W \n \
    5    20    3 \n \
    2    0.07407407407407407    638    0.15633423180592992 \n \
    0    0.0    133    0.043793216990451106 \n \
    W \n \
    5    20    4 \n \
    3    0.083333333333333329    1272    0.21150648486863985 \n \
    0    0.0    349    0.069342340552354456 \n \
    B \n \
    5    20    5 \n \
    5    0.1111111111111111    1494    0.1828193832599119 \n \
    0    0.0    580    0.077831454643048845 \n \
    B \n \
    5    25    1 \n \
    5    0.094339622641509441    1546    0.17366883846326669 \n \
    0    0.0    668    0.081632653061224483 \n \
    W \n \
    5    25    2 \n \
    5    0.084745762711864403    1626    0.16386173536228962 \n \
    1    0.017543859649122806    857    0.093212964977159016 \n \
    W \n \
    5    25    3 \n \
    5    0.079365079365079361    1653    0.15137362637362636 \n \
    2    0.031746031746031744    1236    0.11552481540330872 \n \
    B \n \
    5    25    4 \n \
    5    0.066666666666666666    1997    0.14776174620791713 \n \
    3    0.040000000000000001    2008    0.150536022190569 \n \
    W \n \
    5    25    5 \n \
    7    0.083333333333333329    2308    0.146159204610221 \n \
    5    0.059523809523809521    2269    0.14494697840807461 \n \
    W \n \
    5    30    1 \n \
    7    0.074468085106382975    2338    0.13997485481650002 \n \
    5    0.053763440860215055    2301    0.14063072973964064 \n \
    W \n \
    5    30    2 \n \
    8    0.078431372549019607    2566    0.14212129603987814 \n \
    5    0.049504950495049507    2358    0.13291995490417136 \n \
    B \n \
    5    30    3 \n \
    9    0.081818181818181818    3002    0.14969582128253714 \n \
    5    0.046296296296296294    2433    0.12669235575921683 \n \
    W \n \
    5    30    4 \n \
    10    0.084033613445378158    3633    0.1652565502183406 \n \
    5    0.043103448275862072    2648    0.12492333820823702 \n \
    B \n \
    5    30    5 \n \
    12    0.096000000000000002    3790    0.16204198554876223 \n \
    5    0.040983606557377046    2762    0.1211669225707392 \n \
    B \n \
    5    35    1 \n \
    12    0.090225563909774431    3839    0.15922193189830369 \n \
    5    0.03787878787878788    2874    0.12126582278481013 \n \
    B \n \
    5    35    2 \n \
    12    0.086330935251798566    3915    0.15583330016319707 \n \
    6    0.043478260869565216    3063    0.12398299939283546 \n \
    W \n \
    5    35    3 \n \
    12    0.082191780821917804    3975    0.1495935571278037 \n \
    7    0.048275862068965517    3436    0.13132548539978597 \n \
    W \n \
    5    35    4 \n \
    12    0.077419354838709681    4210    0.14765712682379348 \n \
    8    0.050955414012738856    4195    0.14559905594891018 \n \
    B \n \
    5    35    5 \n \
    14    0.085365853658536592    4526    0.14709610322077415 \n \
    10    0.059171597633136092    4481    0.14049664513701637 \n \
    B \n \
    5    40    1 \n \
    14    0.079545454545454544    4548    0.14274952919020717 \n \
    10    0.055248618784530384    4493    0.13626713575154678 \n \
    B \n \
    5    40    2 \n \
    15    0.080213903743315509    4858    0.14489382009067048 \n \
    10    0.05181347150259067    4626    0.1335527455395808 \n \
    B \n \
    5    40    3 \n \
    16    0.082051282051282051    5334    0.15008441193021946 \n \
    10    0.04975124378109453    4697    0.13008557897360623 \n \
    W \n \
    5    40    4 \n \
    17    0.082125603864734303    5977    0.15697552263893266 \n \
    11    0.052132701421800945    5386    0.13913717385688454 \n \
    B \n \
    5    40    5 \n \
    19    0.087962962962962965    6192    0.15476130967258186 \n \
    11    0.050000000000000003    5601    0.13692033148360916 \n \
    B \n \
    5    45    1 \n \
    19    0.085585585585585586    6213    0.15336575251166351 \n \
    11    0.048245614035087717    5643    0.13568817928248533 \n \
    B \n \
    5    45    2 \n \
    20    0.08771929824561403    6418    0.15493433758207803 \n \
    12    0.05128205128205128    5813    0.1367668164600146 \n \
    W \n \
    5    45    3 \n \
    20    0.085106382978723402    6450    0.15077843751461031 \n \
    13    0.053719008264462811    6172    0.13923165422184122 \n \
    B \n \
    5    45    4 \n \
    22    0.09166666666666666    7337    0.16688274764016831 \n \
    15    0.060483870967741937    7117    0.15431148500682987 \n \
    B \n \
    5    45    5 \n \
    22    0.088353413654618476    7494    0.16259139528324401 \n \
    16    0.061538461538461542    7937    0.16185737300405817 \n \
    B \n \
    5    50    1 \n \
    22    0.084942084942084939    7512    0.16003067680705566 \n \
    16    0.059701492537313432    7944    0.15979402180472302 \n \
    W \n \
    5    50    2 \n \
    23    0.086792452830188674    7680    0.16057875258745061 \n \
    16    0.058608058608058608    7969    0.15834128119535845 \n \
    W \n \
    5    50    3 \n \
    24    0.08727272727272728    8069    0.16271753816370566 \n \
    16    0.057142857142857141    8056    0.15598799496563076 \n \
    W \n \
    5    50    4 \n \
    25    0.088652482269503549    8570    0.16683213611322004 \n \
    17    0.059649122807017542    8546    0.16184686476147189 \n \
    W \n \
    5    50    5 \n \
    27    0.091836734693877556    9731    0.17948245015401074 \n \
    18    0.060606060606060608    9302    0.16695084085647111 \n \
    B \n \
    5    55    1 \n \
    27    0.088815789473684209    9759    0.17723335088898171 \n \
    18    0.058631921824104233    9319    0.16478639128589617 \n \
    W \n \
    5    55    2 \n \
    28    0.090322580645161285    9959    0.17797594581553694 \n \
    19    0.06070287539936102    9485    0.16505124680251274 \n \
    W \n \
    5    55    3 \n \
    28    0.087227414330218064    10079    0.17336635877324252 \n \
    20    0.06097560975609756    9951    0.16561537821419656 \n \
    B \n \
    5    55    4 \n \
    29    0.088957055214723926    10559    0.17802168158751033 \n \
    22    0.065868263473053898    10858    0.1755168679178184 \n \
    B \n \
    5    55    5 \n \
    29    0.085798816568047331    10786    0.17354228343416142 \n \
    23    0.065902578796561598    11702    0.17868649696895661 \n \
    B \n \
    5    60    1 \n \
    29    0.083815028901734104    10800    0.17191977077363896 \n \
    23    0.064425770308123242    11707    0.17697389306284109 \n \
    B \n \
    5    60    2 \n \
    30    0.084269662921348312    11084    0.17222679739577668 \n \
    23    0.062841530054644809    11790    0.17492062550072698 \n \
    W \n \
    5    60    3 \n \
    31    0.084931506849315067    11529    0.17430679447249856 \n \
    23    0.061497326203208559    11871    0.17274698409464631 \n \
    W \n \
    5    60    4 \n \
    33    0.087999999999999995    12466    0.18218753653688763 \n \
    24    0.0625    12414    0.17462617282561296 \n \
    B \n \
    5    60    5 \n \
    34    0.087179487179487175    13355    0.18564597292112653 \n \
    24    0.060150375939849621    12805    0.17139606478383082 \n \
    B \n \
    5    65    1 \n \
    34    0.0845771144278607    13381    0.18345718281279991 \n \
    24    0.058111380145278453    12831    0.16910262661939718 \n \
    B \n \
    5    65    2 \n \
    35    0.085784313725490197    13577    0.18387053087757313 \n \
    25    0.059665871121718374    13005    0.16935578388092354 \n \
    W \n \
    5    65    3 \n \
    35    0.084541062801932368    13660    0.18166584655486548 \n \
    26    0.061032863849765258    13359    0.17096237522395699 \n \
    W \n \
    5    65    4 \n \
    35    0.082938388625592413    13765    0.17900102732155165 \n \
    27    0.062068965517241378    13947    0.17320517119332365 \n \
    B \n \
    5    65    5 \n \
    35    0.080645161290322578    14140    0.17725517725517725 \n \
    28    0.062639821029082776    14833    0.17772798619681521 \n \
    W \n \
    6    20    1 \n \
    35    0.077433628318584066    14183    0.17498858743260418 \n \
    28    0.060215053763440864    14884    0.17559962718703176 \n \
    B \n \
    6    20    2 \n \
    36    0.076271186440677971    14396    0.17231638418079095 \n \
    29    0.060041407867494824    15065    0.17318281621814252 \n \
    W \n \
    6    20    3 \n \
    38    0.078189300411522639    14918    0.17330994342274939 \n \
    30    0.060483870967741937    15351    0.17214658981317424 \n \
    W \n \
    6    20    4 \n \
    39    0.07847082494969819    15368    0.17338718776090439 \n \
    30    0.059288537549407112    15582    0.16970713484430988 \n \
    B \n \
    6    20    5 \n \
    41    0.080392156862745104    16543    0.17892061431970582 \n \
    31    0.059961315280464215    16275    0.17125630044300402 \n \
    W \n \
    6    25    1 \n \
    41    0.076779026217228458    16594    0.17603377675938303 \n \
    31    0.0570902394106814    16342    0.16825913265516249 \n \
    Tie \n \
    6    25    2 \n \
    41    0.073476702508960573    16709    0.17171250051383236 \n \
    32    0.056239015817223195    16561    0.16504389942497236 \n \
    Tie \n \
    6    25    3 \n \
    41    0.072183098591549297    16863    0.17007735831929721 \n \
    33    0.056798623063683308    16960    0.1653730644720933 \n \
    B \n \
    6    25    4 \n \
    42    0.072916666666666671    17260    0.17084879980202919 \n \
    34    0.057529610829103212    17392    0.1657185871232694 \n \
    B \n \
    6    25    5 \n \
    44    0.074829931972789115    18320    0.17526404408388183 \n \
    36    0.059602649006622516    18535    0.17085468824895836 \n \
    W \n \
    6    30    1 \n \
    44    0.072607260726072612    18363    0.17354856392178358 \n \
    36    0.057877813504823149    18586    0.16928836222208055 \n \
    B \n \
    6    30    2 \n \
    45    0.070754716981132074    18586    0.16967782575750659 \n \
    36    0.055214723926380369    18684    0.16445590655834383 \n \
    Tie \n \
    6    30    3 \n \
    46    0.070336391437308868    19063    0.16898174823377152 \n \
    37    0.055306427503736919    18964    0.16280207752071083 \n \
    W \n \
    6    30    4 \n \
    47    0.070889894419306182    19441    0.16948990000261546 \n \
    37    0.054652880354505169    19020    0.16060119902051845 \n \
    B \n \
    6    30    5 \n \
    48    0.071641791044776124    19946    0.17132500730102557 \n \
    37    0.054172767203513911    19146    0.15928452579034941 \n \
    B \n \
    6    35    1 \n \
    48    0.069767441860465115    19989    0.16986904387582538 \n \
    37    0.052631578947368418    19180    0.15767839526471555 \n \
    B \n \
    6    35    2 \n \
    48    0.068965517241379309    20017    0.16865084380186876 \n \
    38    0.053295932678821878    19307    0.15708369606782255 \n \
    B \n \
    6    35    3 \n \
    50    0.069637883008356549    20668    0.16856287669333594 \n \
    41    0.055782312925170066    20215    0.15931874783266606 \n \
    W \n \
    6    35    4 \n \
    51    0.069767441860465115    21167    0.16872992211974588 \n \
    42    0.056074766355140186    20793    0.15966980226531005 \n \
    B \n \
    6    35    5 \n \
    53    0.071332436069986543    22227    0.17232904326252133 \n \
    44    0.05774278215223097    21926    0.16393393595466135 \n \
    W \n \
    6    40    1 \n \
    53    0.069645203679369244    22271    0.17097475030516127 \n \
    44    0.056410256410256411    21976    0.16272250688623641 \n \
    B \n \
    6    40    2 \n \
    54    0.069142125480153652    22483    0.16935708636209559 \n \
    45    0.056390977443609019    22159    0.16138876345573991 \n \
    W \n \
    6    40    3 \n \
    57    0.071518193224592227    23428    0.17276649091110211 \n \
    47    0.057881773399014777    22753    0.16271668859774588 \n \
    W \n \
    6    40    4 \n \
    58    0.071960297766749379    23802    0.17313189650783029 \n \
    47    0.05731707317073171    22790    0.16075673464205351 \n \
    B \n \
    6    40    5 \n \
    59    0.071601941747572811    24854    0.17404396266184885 \n \
    47    0.056019070321811679    23317    0.15916910138437593 \n \
    W \n \
    6    45    1 \n \
    59    0.069739952718676126    24918    0.1726113370139721 \n \
    47    0.054461181923522596    23364    0.15762204171951319 \n \
    B \n \
    6    45    2 \n \
    59    0.069086651053864162    24944    0.17160272153771008 \n \
    48    0.054982817869415807    23490    0.1571689516048094 \n \
    B \n \
    6    45    3 \n \
    61    0.070601851851851846    25501    0.17333351459003132 \n \
    51    0.057627118644067797    24302    0.16032775421073117 \n \
    B \n \
    6    45    4 \n \
    62    0.071100917431192664    25896    0.17380215709041122 \n \
    52    0.058100558659217878    24716    0.16052582013262409 \n \
    B \n \
    6    45    5 \n \
    66    0.074492099322799099    27796    0.18245789079833533 \n \
    56    0.061606160616061605    26760    0.16933493640448016 \n \
    B \n \
    6    50    1 \n \
    66    0.071895424836601302    27874    0.18030220704287303 \n \
    56    0.05951115834218916    26838    0.16735467617824226 \n \
    B \n \
    6    50    2 \n \
    67    0.070974576271186446    28090    0.17799209205657221 \n \
    57    0.05894519131334023    27018    0.16520425820732162 \n \
    B \n \
    6    50    3 \n \
    68    0.070612668743509868    28613    0.17769952614287754 \n \
    58    0.058883248730964469    27489    0.16482587422650741 \n \
    B \n \
    6    50    4 \n \
    69    0.07098765432098765    28985    0.17793343073579787 \n \
    58    0.058408862034239679    27539    0.16324728059515695 \n \
    B \n \
    6    50    5 \n \
    70    0.0708502024291498    29584    0.17723460340282771 \n \
    58    0.057711442786069649    27780    0.16128844970331752 \n \
    B \n \
    6    55    1 \n \
    70    0.069582504970178927    29626    0.17615964133026513 \n \
    58    0.056585365853658538    27812    0.16012159384661442 \n \
    B \n \
    6    55    2 \n \
    70    0.069033530571992116    29654    0.17527144199682013 \n \
    59    0.057004830917874394    27943    0.15971079103795152 \n \
    B \n \
    6    55    3 \n \
    72    0.0703125    30258    0.17701051252201078 \n \
    62    0.059216809933142309    28714    0.16215269934492885 \n \
    B \n \
    6    55    4 \n \
    73    0.070736434108527133    30645    0.17732938303609661 \n \
    63    0.059602649006622516    29149    0.16241168735652678 \n \
    B \n \
    6    55    5 \n \
    77    0.073825503355704702    32517    0.18511434085358563 \n \
    67    0.062792877225866919    31082    0.17044307962272429 \n \
    B \n \
    6    60    1 \n \
    77    0.072436500470366885    32547    0.18378998012287676 \n \
    67    0.061637534498620056    31104    0.16924123296242893 \n \
    B \n \
    6    60    2 \n \
    78    0.072022160664819951    32761    0.18244443578163025 \n \
    68    0.061538461538461542    31286    0.16820520540433012 \n \
    W \n \
    6    60    3 \n \
    81    0.073972602739726029    33583    0.18486631693098685 \n \
    70    0.062780269058295965    31826    0.16948286053583125 \n \
    W \n \
    6    60    4 \n \
    82    0.074275362318840576    33951    0.18497673557006025 \n \
    70    0.062333036509349952    31877    0.16803280848888022 \n \
    B \n \
    6    60    5 \n \
    83    0.074239713774597496    34574    0.18421487295066682 \n \
    70    0.061619718309859156    32117    0.16616567416689518 \n \
    W \n \
    6    65    1 \n \
    83    0.072807017543859653    34637    0.18303889913492891 \n \
    70    0.060344827586206899    32162    0.16490880843361758 \n \
    B \n \
    6    65    2 \n \
    83    0.072299651567944254    34664    0.18220428072831252 \n \
    71    0.060683760683760683    32296    0.16453123169172301 \n \
    B \n \
    6    65    3 \n \
    85    0.073402417962003461    35232    0.18346942176303949 \n \
    74    0.062605752961082908    33133    0.16697323529856425 \n \
    B \n \
    6    65    4 \n \
    86    0.073441502988898372    35735    0.18335608074132606 \n \
    75    0.062709030100334448    33714    0.16705067411888871 \n \
    B \n \
    6    65    5 \n \
    88    0.074387151310228231    36816    0.18550093717878952 \n \
    77    0.063688999172870145    34858    0.16971367086512198 \n \
    W \n \
    7    20    1 \n \
    88    0.073272273105745217    36835    0.18448401071795256 \n \
    77    0.062857142857142861    34874    0.16890180409250516 \n \
    W \n \
    7    20    2 \n \
    89    0.072891072891072897    36943    0.18301025943337809 \n \
    78    0.062650602409638559    34997    0.16772823779193205 \n \
    Tie \n \
    7    20    3 \n \
    90    0.072522159548751006    37184    0.1814012937721361 \n \
    79    0.062450592885375494    35231    0.16640138293902881 \n \
    Tie \n \
    7    20    4 \n \
    91    0.072164948453608241    37554    0.17973925029674159 \n \
    79    0.06147859922178988    35324    0.16375993250071857 \n \
    Tie \n \
    7    20    5 \n \
    94    0.073380171740827477    38529    0.18028552578014234 \n \
    81    0.062068965517241378    35883    0.16271403177827759 \n \
    Tie \n \
    7    25    1 \n \
    94    0.072030651340996163    38557    0.17909165226761795 \n \
    81    0.060856498873027798    35910    0.16152174988642651 \n \
    Tie \n \
    7    25    2 \n \
    95    0.071482317531978937    38674    0.17748264135876973 \n \
    83    0.061164333087693444    36128    0.16044766176666519 \n \
    Tie \n \
    7    25    3 \n \
    95    0.07021433850702144    38848    0.17527047634516302 \n \
    84    0.060737527114967459    36479    0.15920447949444208 \n \
    Tie \n \
    7    25    4 \n \
    96    0.069716775599128547    39316    0.17358363944617122 \n \
    85    0.060326472675656495    36948    0.15768314854172535 \n \
    Tie \n \
    7    25    5 \n \
    96    0.06852248394004283    39648    0.17060020739835544 \n \
    86    0.059930313588850176    37570    0.15612598124161087 \n \
    Tie \n \
    7    30    1 \n \
    96    0.067085953878406712    39697    0.16938904392500234 \n \
    86    0.058703071672354952    37610    0.1549777484753585 \n \
    Tie \n \
    7    30    2 \n \
    97    0.066392881587953451    39869    0.16776987136058172 \n \
    87    0.058193979933110367    37799    0.15366321660582311 \n \
    Tie \n \
    7    30    3 \n \
    99    0.066398390342052319    40324    0.16652419358169077 \n \
    88    0.057704918032786885    38087    0.15196080387173483 \n \
    Tie \n \
    7    30    4 \n \
    100    0.065746219592373437    40715    0.16411449117050736 \n \
    88    0.056591639871382639    38267    0.14905891151586917 \n \
    Tie \n \
    7    30    5 \n \
    103    0.066408768536428117    41995    0.16447471487655094 \n \
    90    0.056782334384858045    38941    0.14748870380680765 \n \
    Tie \n \
    7    35    1 \n \
    103    0.064984227129337546    42036    0.16321681091218301 \n \
    90    0.055521283158544106    38983    0.14626175763237773 \n \
    Tie \n \
    7    35    2 \n \
    104    0.064237183446571963    42174    0.16137660280325555 \n \
    92    0.055522027761013878    39210    0.14493235750720782 \n \
    Tie \n \
    7    35    3 \n \
    104    0.062915910465819722    42336    0.1587461097153999 \n \
    93    0.05493207324276432    39540    0.14321105702364395 \n \
    Tie \n \
    7    35    4 \n \
    105    0.062240663900414939    42907    0.15683185543119896 \n \
    94    0.054366685945633313    40143    0.14170785088957921 \n \
    Tie \n \
    7    35    5 \n \
    105    0.061153174140943505    43234    0.15389982308319361 \n \
    95    0.053946621237932993    40727    0.13991686134396042 \n \
    B \n \
    7    40    1 \n \
    105    0.059760956175298807    43260    0.15254470377906054 \n \
    95    0.052748473070516382    40754    0.1386964156876625 \n \
    Tie \n \
    7    40    2 \n \
    106    0.058987200890372841    43430    0.15081170240472264 \n \
    96    0.052145573058120585    40953    0.13730315455615272 \n \
    Tie \n \
    7    40    3 \n \
    108    0.058791507893304298    43910    0.14932377516076706 \n \
    97    0.051568314726209465    41298    0.13564699854164203 \n \
    Tie \n \
    7    40    4 \n \
    109    0.05819540843566471    44396    0.14737408173359404 \n \
    97    0.050626304801670144    41503    0.13330827961237396 \n \
    W \n \
    7    40    5 \n \
    112    0.059353471118177001    45422    0.14913190796385795 \n \
    99    0.051348547717842322    42021    0.13375157557006989 \n \
    W \n \
    7    45    1 \n \
    112    0.05848563968668407    45463    0.14841039000042439 \n \
    99    0.050561797752808987    42059    0.13304757686954322 \n \
    B \n \
    7    45    2 \n \
    113    0.05774144098109351    45633    0.14692312397976762 \n \
    100    0.049950049950049952    42297    0.13199251053206429 \n \
    B \n \
    7    45    3 \n \
    113    0.056471764117941033    45932    0.14446069412338225 \n \
    101    0.04931640625    42667    0.1300763684587595 \n \
    Tie \n \
    7    45    4 \n \
    114    0.056463595839524518    46301    0.14385268312082122 \n \
    102    0.049323017408123788    43058    0.12954800509069683 \n \
    B \n \
    7    45    5 \n \
    114    0.055501460564751706    46627    0.14121905050352085 \n \
    103    0.048954372623574147    43750    0.12822579463356731 \n \
    B \n \
    7    50    1 \n \
    114    0.05418250950570342    46695    0.14003682733139799 \n \
    103    0.047818012999071492    43820    0.12718628640424456 \n \
    Tie \n \
    7    50    2 \n \
    115    0.053389043639740022    46964    0.13845559686201905 \n \
    104    0.047186932849364795    44067    0.12576665230159795 \n \
    Tie \n \
    7    50    3 \n \
    118    0.053539019963702361    47684    0.13723910065275202 \n \
    106    0.047027506654835849    44667    0.1246122171137794 \n \
    Tie \n \
    7    50    4 \n \
    119    0.053220035778175315    48129    0.13603332928211462 \n \
    106    0.046369203849518807    44774    0.1227017739057991 \n \
    B \n \
    7    50    5 \n \
    121    0.053163444639718803    49205    0.13519194206020377 \n \
    108    0.046431642304385214    45749    0.12197814210564205 \n \
    B \n \
    7    55    1 \n \
    121    0.051931330472103007    49290    0.13418707785790707 \n \
    108    0.0453781512605042    45832    0.12101145637784132 \n \
    W \n \
    7    55    2 \n \
    122    0.051174496644295304    49533    0.13287247911670502 \n \
    110    0.045155993431855501    46214    0.12018058033276295 \n \
    Tie \n \
    7    55    3 \n \
    122    0.050664451827242524    49613    0.13174519295878998 \n \
    111    0.045085296506904952    46407    0.11945788714991763 \n \
    B \n \
    7    55    4 \n \
    122    0.050082101806239739    49823    0.13032673891491606 \n \
    112    0.044979919678714862    46752    0.11862286646554503 \n \
    W \n \
    7    55    5 \n \
    122    0.049114331723027378    50222    0.12738649939505237 \n \
    113    0.044488188976377956    47458    0.11673205347369975 \n \
    B \n \
    7    60    1 \n \
    122    0.047955974842767299    50283    0.12631253705248138 \n \
    113    0.043461538461538461    47515    0.11564119226154404 \n \
    Tie \n \
    7    60    2 \n \
    124    0.047950502706883218    50557    0.12549427472862984 \n \
    114    0.043149129447388343    47759    0.11486575865660047 \n \
    B \n \
    7    60    3 \n \
    127    0.048696319018404911    51141    0.12582885740085081 \n \
    116    0.043576258452291509    48184    0.11498252019424658 \n \
    W \n \
    7    60    4 \n \
    128    0.047976011994002997    52065    0.12446808510638298 \n \
    116    0.042615723732549599    48822    0.11325613116944576 \n \
    Tie \n \
    7    60    5 \n \
    130    0.048309178743961352    52844    0.1247600722439295 \n \
    117    0.04263848396501458    49232    0.11281160562683171 \n \
    B \n \
    7    65    1 \n \
    130    0.047497259773474604    52941    0.12408531583264971 \n \
    117    0.041905444126074498    49319    0.11214853387604744 \n \
    B \n \
    7    65    2 \n \
    130    0.046411995715815779    53211    0.12262802992242845 \n \
    118    0.041287613715885234    49697    0.11102051211023192 \n \
    Tie \n \
    7    65    3 \n \
    132    0.046659597030752918    53677    0.12239653403260746 \n \
    120    0.041580041580041582    50231    0.11109440071481178 \n \
    W \n \
    7    65    4 \n \
    133    0.046228710462287104    54375    0.12121421533440634 \n \
    121    0.041240627130197681    50911    0.11008759695454083 \n \
    W \n \
    7    65    5 \n \
    133    0.045720178755586115    54865    0.12003290430840788 \n \
    122    0.041118975396022918    51533    0.10944651280341339 \n \
    W \n \
    8    20    1 \n \
    133    0.045407989074769547    54893    0.11974729879779322 \n \
    122    0.040843655841981921    51563    0.10918928076063825 \n \
    Tie \n \
    8    20    2 \n \
    134    0.045439131909121737    55016    0.11948519031713006 \n \
    122    0.040571998669770536    51599    0.10879713579663819 \n \
    Tie \n \
    8    20    3 \n \
    137    0.046143482654092287    55559    0.11995068893005341 \n \
    124    0.040964651470102413    51968    0.10893891052704396 \n \
    Tie \n \
    8    20    4 \n \
    138    0.046169287387085985    55899    0.11977014006286438 \n \
    124    0.040695766327535278    52028    0.1082644559309478 \n \
    Tie \n \
    8    20    5 \n \
    139    0.046194749086075106    56394    0.11973985659414274 \n \
    125    0.040756439517443753    52430    0.10812672460372783 \n \
    Tie \n \
    8    25    1 \n \
    139    0.045829212001318828    56448    0.11947576958244438 \n \
    125    0.040413837698027803    52494    0.10788027003976614 \n \
    Tie \n \
    8    25    2 \n \
    139    0.045469414458619559    56494    0.11896529213819128 \n \
    126    0.040397563321577429    52636    0.10759629516822397 \n \
    Tie \n \
    8    25    3 \n \
    141    0.045764362220058426    56838    0.11893805754176266 \n \
    129    0.041017488076311608    53174    0.10796532050110658 \n \
    Tie \n \
    8    25    4 \n \
    143    0.046054750402576491    57387    0.11910242015320788 \n \
    131    0.0413118889940082    53694    0.10807079125917547 \n \
    Tie \n \
    8    25    5 \n \
    143    0.045701502077341007    57541    0.11821444640072645 \n \
    132    0.041288708163903662    54189    0.10791418483358525 \n \
    Tie \n \
    8    30    1 \n \
    143    0.045267489711934158    57590    0.11785266268435582 \n \
    132    0.040904865199876045    54238    0.10760760661462002 \n \
    Tie \n \
    8    30    2 \n \
    144    0.045155221072436504    57737    0.11745881912558412 \n \
    132    0.04052809333742708    54297    0.10711347751380419 \n \
    Tie \n \
    8    30    3 \n \
    147    0.045666356011183594    58281    0.11765596516409577 \n \
    134    0.04076665652570733    54683    0.10705573719140939 \n \
    Tie \n \
    8    30    4 \n \
    150    0.046168051708217916    59041    0.11792445293088434 \n \
    136    0.041000904431715404    55264    0.1070723470706421 \n \
    Tie \n \
    8    30    5 \n \
    151    0.046050625190606889    59453    0.11721667330433788 \n \
    136    0.040633403047505227    55363    0.10592120241600517 \n \
    Tie \n \
    8    35    1 \n \
    151    0.045578025958345911    59533    0.11689204180648304 \n \
    136    0.040201005025125629    55455    0.10562655949410488 \n \
    Tie \n \
    8    35    2 \n \
    151    0.045115028383627132    59616    0.11622910484716856 \n \
    137    0.040070195963732083    55657    0.10522007418358358 \n \
    Tie \n \
    8    35    3 \n \
    151    0.044661342797988758    59821    0.11555862058307641 \n \
    138    0.039942112879884223    56028    0.10488579713617668 \n \
    Tie \n \
    8    35    4 \n \
    151    0.044216691068814054    60093    0.11479170805507588 \n \
    139    0.039816671440847898    56402    0.10439324503409318 \n \
    Tie \n \
    8    35    5 \n \
    152    0.044070745143519864    60580    0.11422839267565585 \n \
    140    0.039693790757017296    56958    0.10400172368459494 \n \
    Tie \n \
    8    40    1 \n \
    152    0.043565491544855256    60654    0.11383859446291059 \n \
    140    0.039248668348752451    57034    0.10364560522934729 \n \
    Tie \n \
    8    40    2 \n \
    153    0.043355058090110511    60821    0.11330987188109552 \n \
    140    0.038813418353202109    57118    0.1030642477959141 \n \
    Tie \n \
    8    40    3 \n \
    154    0.043149341552255534    61084    0.11266431442130521 \n \
    141    0.038661913901837125    57391    0.10255755024142331 \n \
    Tie \n \
    8    40    4 \n \
    155    0.042948185092823499    61479    0.11203707415925268 \n \
    141    0.038242473555736373    57522    0.1015607895759031 \n \
    Tie \n \
    8    40    5 \n \
    156    0.042868920032976092    62012    0.11167900300754588 \n \
    142    0.038223418573351278    57906    0.10114143487183966 \n \
    W \n \
    8    45    1 \n \
    159    0.043171327721965788    62329    0.11175899976511047 \n \
    146    0.038819462908800853    58295    0.10134312893759648 \n \
    Tie \n \
    8    45    2 \n \
    159    0.042661658170110008    62415    0.11105200041278641 \n \
    147    0.038613081166272656    58490    0.10086934927284047 \n \
    Tie \n \
    8    45    3 \n \
    160    0.042429063908777515    62744    0.11049571975253636 \n \
    149    0.038671165325720215    58961    0.10060625502297559 \n \
    Tie \n \
    8    45    4 \n \
    160    0.041939711664482307    63142    0.10970113728365376 \n \
    150    0.038471402923826621    59615    0.10033897962756003 \n \
    Tie \n \
    8    45    5 \n \
    161    0.041720653018916816    63835    0.10913700810556208 \n \
    151    0.038276299112801011    60609    0.10034768787562708 \n \
    Tie \n \
    8    50    1 \n \
    161    0.04118700434893835    63955    0.10874351968197345 \n \
    151    0.037797246558197745    60722    0.099973657347953507 \n \
    Tie \n \
    8    50    2 \n \
    162    0.040919424096994193    64155    0.10815599548865336 \n \
    151    0.037330037082818297    60847    0.099299078765921686 \n \
    Tie \n \
    8    50    3 \n \
    164    0.040907957096532804    64646    0.10775213309086909 \n \
    153    0.037362637362637362    61290    0.09890014135507233 \n \
    Tie \n \
    8    50    4 \n \
    166    0.041058619836754885    65400    0.10799599721258038 \n \
    155    0.037557547855585169    61863    0.098982066970457222 \n \
    W \n \
    8    50    5 \n \
    167    0.040861267433325174    66053    0.10743749227396047 \n \
    155    0.037179179659390743    62282    0.098245425850589096 \n \
    W \n \
    8    55    1 \n \
    175    0.042260323593334946    66730    0.10802891347811658 \n \
    164    0.038816568047337276    63014    0.098907394588927028 \n \
    Tie \n \
    8    55    2 \n \
    175    0.041716328963051254    66828    0.10728441736701423 \n \
    165    0.038542396636299929    63245    0.098383275543173054 \n \
    Tie \n \
    8    55    3 \n \
    177    0.041656860437750055    67288    0.10681245277507921 \n \
    168    0.038736453769887019    63935    0.098324780120662578 \n \
    Tie \n \
    8    55    4 \n \
    177    0.041326173243053932    67449    0.10610694228137241 \n \
    169    0.038646238280356737    64410    0.098147374965333753 \n \
    B \n \
    8    55    5 \n \
    178    0.041042195065713626    68080    0.10529327610872675 \n \
    170    0.038383382253330323    65139    0.097552464832500421 \n \
    Tie \n \
    8    60    1 \n \
    178    0.040482146918353425    68220    0.10491317212403807 \n \
    170    0.03787034974381822    65280    0.097195794137878669 \n \
    Tie \n \
    8    60    2 \n \
    179    0.040161543639219206    68463    0.10430486277640491 \n \
    170    0.037370850736425591    65537    0.096719446162110631 \n \
    Tie \n \
    8    60    3 \n \
    181    0.040070843480185962    69007    0.10386957712813195 \n \
    172    0.037318290301583859    66037    0.096303436689717928 \n \
    Tie \n \
    8    60    4 \n \
    182    0.039764037579200349    69543    0.10311511652217235 \n \
    173    0.037052902120368388    66437    0.09547342962540363 \n \
    Tie \n \
    8    60    5 \n \
    183    0.039533376539209332    70109    0.10238223538465807 \n \
    173    0.036644778648591399    66753    0.094501331453301446 \n \
    B \n \
    8    65    1 \n \
    183    0.038994246750479439    70262    0.1020583950299877 \n \
    173    0.036139544599958218    66916    0.094175332525505001 \n \
    Tie \n \
    8    65    2 \n \
    183    0.038469623712423795    70394    0.10134743104116006 \n \
    174    0.035854110859262309    67165    0.093681829086628324 \n \
    Tie \n \
    8    65    3 \n \
    185    0.038373781373159097    70957    0.10087716804094399 \n \
    177    0.03598292335840618    67882    0.093440370887327012 \n \
    Tie \n \
    8    65    4 \n \
    185    0.037871033776867964    71481    0.09997258764262118 \n \
    178    0.035707121364092279    68721    0.093061015558242866 \n \
    Tie \n \
    8    65    5 \n \
    186    0.037583350171751871    72202    0.099074325640877869 \n \
    179    0.035438527024351615    69533    0.092331124192154113 \n \
    Tie \n \
    "
    
    parsed_file.write("Bond - White, BondWithNoFramePenalty - Black\n")
    parsed_file.write("#experiment    size    turns_limit    time_limit    #Bond_root_cache_hit(accumulated)    #Bond_root_cache_ratio(accumulated)    #Bond_leaves_cache_hit(accumulated)    #Bond_leaves_cache_ratio(accumulated)    #BondNoFramePenalty_root_cache_hit(accumulated)    #BondNoFramePenalty_root_cache_ratio(accumulated)    #BondNoFramePenalty_leaves_cache_hit(accumulated)    #BondNoFramePenalty_leaves_cache_ratio(accumulated)    winner\n")
    i = 0
    full_line = "0"
    for line in text.splitlines():
        full_line = full_line + "    " + line.replace("\n", "")
        i += 1
        if i%4 == 0:
            full_line = full_line + "\n"
            parsed_file.flush()
            parsed_file.write(full_line)
            parsed_file.flush()
            full_line = str(i/4)
    
    parsed_file.close()
    print "end"